Release 10.1A: OpenEdge Development:
Progress 4GL Reference
FIRST function
Returns a TRUE value if the current iteration of a DO, FOR EACH, or REPEAT . . . BREAK block is the first iteration of that block.
Syntax
break-groupThe name of a field or expression you name in the block header with the BREAK BY option.
ExampleThe
r-first.pprocedure displays the order number, order-lines on the order, the extended price of each order-line, and a total order value for each order record:
Because the inner FOR EACH block iterates until Progress reads all the order-lines, the procedure must set the order-value variable to 0 each time a new order is used in that block. The FIRST function uses the (
qty * price) expression as thebreak-groupto keep track of whether or not the current iteration is the first iteration of the FOR EACH block.See also
DO statement, FIRST-OF function, FOR statement, LAST function, LAST-OF function, REPEAT statement
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |